#include <iostream>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time.hpp>
using namespace std;
using namespace boost::gregorian;
using namespace boost::posix_time;

int main() {
    date d1;
    date d2(1990,9,8);
    d1.is_not_a_date()?cout<<"不是一个合法日期":cout<<"是一个合法日期\n";
    cout<<"这个日期是一年的第:"<<d2.week_number()<<"周\n";
    cout<<"这个日期下当月最后一天的时间为:"<<d2.end_of_month()<<"\n";
    cout<<"这个日期天数:"<<d2.day_count()<<"\n";
    cout<<"这个日期是一个星期中的:"<<d2.day_of_week()<<"\n";
    cout<<"这个日期是一年中的:"<<d2.day_of_year()<<"\n";
    cout<<"julian时间:"<<d2.julian_day()<<"\n";
    cout<<"modjulian:"<<d2.modjulian_day()<<"\n";
    cout<<"月:"<<d2.month()<<"\n";
    cout<<"年:"<<d2.year()<<"\n";
    date d = day_clock::local_day();
    date d4 = day_clock::universal_day();
    date::ymd_type ymd = d4.year_month_day();
    cout<<ymd.year<<":"<<ymd.month<<":"<<ymd.day<<endl;
    cout<<to_simple_string(d2)<<"\n";
    cout<<to_iso_string(d2)<<"\n";
    cout<<to_iso_extended_string(d2)<<"\n";

    tm t = to_tm(d1);
//    cout<<t.tm_hour<<endl;
//    d2.is_special()?:cout<<"是特别的数字":cout<<"不是特别的数字";
    return 0;
}